package ru.elifantiev.cityrouter.util;


import android.content.res.AssetManager;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AssetProvider {
    public static String getStringAsset(AssetManager assets, String path) throws IOException {
        String line;
        StringBuilder builder = new StringBuilder();
        BufferedReader reader;

        reader = new BufferedReader(
                new InputStreamReader(assets.open(path)), 8192);
        while ((line = reader.readLine()) != null)
            builder.append(line);
        reader.close();

        return builder.toString();
    }
}
